package com.wl.thread.demo03;

/**
 * 线程插队
 */
public class TestThreadJoin implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println("VIP来了"+i);
        }
    }

    public static void main(String[] args) {
        TestThreadJoin testThreadJoin = new TestThreadJoin();
        Thread thread  = new Thread(testThreadJoin);
        thread.start();

        for (int i = 0; i < 100; i++) {
            if (i == 50){
                try {
                    thread.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println("main..."+i);
        }
    }
}
